<template>
	<div class="" >
		<div class="topmenu">
			<router-link to="/shuisi">
				<div class="logo1" style="background-color: #246bb3;width: 270px;">
					<img src="../assets/img/logo1.png"/>
				</div>
			</router-link>
			<span style = "display:inline-block;height:22px;width:1px;background:#8FBAE5;float:left;margin-top:7px;"></span>
			<router-link to="/shuisi">
				<div class="logo1" style = "width:225px;">
					<p class="lab">实验室信息管理系统</p>
				</div>
			</router-link>
			<!--<div class ="menuCon">-->
				<!--<div class="menuItem">
					<div v-for="(item,key) in modelData" :key = "key" v-bind:class="{'topmenuitem':true,'active':topmenu==key}" v-on:click="changetopmenu(item,key)">

						<img width="18" :src="imgsDef[0][item.pageAddress]" alt="" style="vertical-align: middle;" /> {{item.name}}
					</div>
				</div>-->
				<div class="userInfo">
					<el-select v-model="labValue" value-key='id' placeholder="切换水司" size="mini" filterable class="changeLab" @change="changeLab">
						<el-option v-for="item in labData" :key="item.id" :label="item.name" :value="item">
						</el-option>
					</el-select>
          <!-- <el-select v-model="labValue"  placeholder="切换水司" size="mini">
          	<el-option v-for="item in labData" :key="item.id" :label="item.name" :value="item.id">
          	</el-option>
          </el-select> -->
					<!--<el-button class="infoPopBtn" type="" icon="el-icon-bell"></el-button>-->
					<!--<div class="infoPopBox" style="display: inline-block;cursor:pointer;" v-if = "!ishome">
						<i ref="infoPopBtn" @click="checkInfoBtn" :class="{'hasSign':isHasSign>0,'el-icon-bell':true,'infoPopBtn':true,}">
						</i>
						<daibanlist :daiban="todaDataStyle" v-if="showPop"></daibanlist>
					</div>-->
					<el-dropdown trigger="hover" @command="handleCommand1" style = "color：#fff">
						<span style="font-size: 14px;color: #fff;cursor:pointer;">您好！{{userInfo.name}}</span>
						<span class="el-dropdown-link">
							 <i class="el-icon-caret-bottom"></i>
						</span>
						<el-dropdown-menu slot="dropdown">
							<el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
            	<el-dropdown-item divided command="changePsd">修改密码</el-dropdown-item>

              <el-dropdown-item v-for="(item,index) in configData" :key="index"  divided :command="item.key">{{item.name}}</el-dropdown-item>
						</el-dropdown-menu>
					</el-dropdown>
					<!--<div class="loginOut" style="cursor:pointer;" @click = "isShow = !isShow">
						<i class="el-icon-setting"></i>
						<el-select v-model="loginValue" size="mini" class="changeLab" placeholder = "设置" @change="choseeOprate" v-if = "isShow">
							<el-option  key="changePsd" label="重置密码" value="changePsd">
							</el-option>
							<el-option  key="loginOut" label="退出" value="loginOut">
							</el-option>
						</el-select>
					</div>-->

				</div>
			<!--</div>-->
		</div>
		<div class="menuItem">
			<div v-for="(item,key) in modelData" :key = "key" v-bind:class="{'topmenuitem':true,'active':topmenu==key}" v-on:click="changetopmenu(item,key)">
				<img width="14" :src="imgsDef[0][item.pageAddress]" alt="" style="vertical-align: middle;" /> {{item.name}}
			</div>
		</div>

		<div  :class = "{'left-menu':true,'left-hide':ishome,'left-show':!ishome}">
			<!--<router-link to="/zhongxin">-->
			<!--<router-link to="/shuisi">
				<div class="logo1" style="background-color: #246bb3;">
					<img src="../assets/img/logo.png" />
				</div>
			</router-link>-->
			<div class = "left-con">
				<!--<router-link to="/shuisi">
					<div class="logo1">
						<p class="lab">实验室信息管理系统</p>
					</div>
				</router-link>-->
				<!--:class="modelData[topmenu].page?modelData[topmenu].page:''"-->
				<div class="accordion" v-if = "reload">
					<!--{{modelData[topmenu].sub}}-->
					<div class="section" v-for="(item,key) in modelData[topmenu].sub" :key="key">
						<input v-if="item.sub != undefined && item.sub.length>0" type="checkbox" v-bind:name="'accordion-'+key" v-bind:id="'manu1-'+key"
						v-bind:ref="key==0?'firstsection':'othsection'" :key="key" checked />
						<label v-if="item.sub != undefined &&item.sub.length>0 && !item.page" class="left-menu-title1" v-bind:for="'manu1-'+key">

							<span>{{item.name}}</span>
							<div class="arrow"></div>
						</label>
						<label v-if="item.sub != undefined &&item.sub.length>0 && item.page" v-on:click="openpage(item,item.page)" class="left-menu-title1"
						v-bind:for="'manu1-'+key">
							<span class="titleicon glyphicon glyphicon-cog" aria-hidden="true" style="width: 20px;">
								<i class="el-icon-menu"></i>
							</span>
							<span>{{item.name}}</span>
							<div class="arrow"></div>
						</label>
						<label v-if="item.sub ==undefined  || item.sub.length==0" class="left-menu-title1" v-on:click="openpage(item,item.page)"
						:key="item.page" :class="{'nowPage':(nowpage==item.page)}">
							<span class="titleicon glyphicon glyphicon-cog" aria-hidden="true"></span>
							<span>{{item.name}}</span>
						</label>
						<div class="content"  v-if="item.sub != undefined && item.sub.length>0">
							<ul>
								<div v-for="(item2,key2) in item.sub"  :key="key2">
									<input v-if="item2.sub != undefined && item2.sub.length>0" type="checkbox" :name="'accordion2-'+key2" :id="'manu1-'+key+'-'+key2"
									value="toggle" checked/>
									<li v-if="item2.sub ==undefined || item2.sub.length==0" v-on:click="openpage(item2,item2.page)" :key="item2.page" :class="{'nowPage':(nowpage==item2.page)}">
										<span>{{item2.name}}</span>
										<div v-if="item2.tip" class="tip inlineblock">{{item2.tip}}</div>
									</li>
									<label v-if="item2.sub != undefined && item2.sub.length>0" :key="item2.page" :class="{'left-menu-title2':true}" :for="'manu1-'+key+'-'+key2">
										<span>{{item2.name}}</span>
										<span class="titleicon" style="width: 20px;">
										</span>
										<div class="arrow"></div>
									</label>
									<div v-if="item2.sub != undefined &&item2.sub.length>0" class="content">
										<ul>
											<li v-for="(item3,key3) in item2.sub" v-on:click="openpage(item3,item3.page)" :key="item3.page" :class="{'nowPage':(nowpage==item3.page)}">
												<span>{{item3.name}}</span>
												<div v-if="item3.tip" class="tip inlineblock">{{item3.tip}}</div>
											</li>
										</ul>
									</div>
								</div>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<el-dialog :close-on-click-modal="false" :visible.sync="changePsdPop" width="50%" :show-close='false'>
			<span slot="title" class="dialog-title">
		  	    修改密码
			    <el-button @click="closePsd" size="mini" class="popupClose">关闭</el-button>
			</span>
			<el-form :model="passwordForm" :rules="rules2" ref="passwordForm" label-width="85px" class="demo-passwordForm">
				<!--<span style="font-size:16px"><b>账号登录</b></span>-->
				<el-form-item label="旧密码" prop="oldPassword" class="lbl">
					<el-input type="password" v-model="passwordForm.oldPassword" class="ipt" auto-complete="new-password" :name = "Math.random()"></el-input>
				</el-form-item>
				<el-form-item label="新密码" prop="newPassword" class="lbl">
					<el-input type="password" v-model="passwordForm.newPassword" auto-complete="new-password"   class="ipt" :name = "Math.random()"></el-input>
				</el-form-item>
				<el-form-item label="确认密码" prop="subPassword" class="lbl">
					<el-input type="password" v-model="passwordForm.subPassword" auto-complete="new-password"   class="ipt" :name = "Math.random()"></el-input>
				</el-form-item>

			</el-form>


			<span slot="footer" class="dialog-footer">
			    <el-button type="primary" @click="getPassPublicKey" size="mini">确 定</el-button>
			    <el-button @click="closePsd" size="mini">取 消</el-button>
			  </span>
		</el-dialog>
		<daibanlist :daiban="todaDataStyle" v-if="ishome" class = "homeDaiBan"></daibanlist>
		<div  v-if="ishome" class="waterFoot">
			<!--<img src = "../assets/img/water1.png" style = "height:85%;">-->
			生命水 &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;  政治水  &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 经济水
		</div>
	</div>
</template>

<script>
	import $ from 'jquery'
	import { mapState } from 'vuex'
	import daibanlist from '@/common/daibanlist.vue'

	export default {
		name: 'App',
		data() {
			var validatePass = (rule, value, callback) => {
					if (!value) {
						callback(new Error('请输入新密码'));
					} else if (value.toString().length < 6) {
						callback(new Error('密码长度至少为6个字符'))
					} else {
						callback();
					}
				};
				var validatePass2 = (rule, value, callback) => {
	                if (value === '') {
	                	callback(new Error('请再次输入密码'));
	                } else if (value !== this.passwordForm.newPassword) {
	                	callback(new Error('两次输入密码不一致!'));
	                } else {
	                	callback();
	                }
	            }
			return {
         		buttonFlag: true,
				isHasSign: 0,
				todaDataStyle: null,
				showPop: false,//显示隐藏代办信息窗
				userInfo: '',
				labData: [],
				labValue: {},
				imgsDef: [{
					"homePage":require("../assets/img/active0.png"),
					"testManage":require("../assets/img/active1.png"),
					"reportManage":require("../assets/img/active2.png"),
					"resourcesManage":require("../assets/img/active3.png"),
					"qcManage":require("../assets/img/active4.png"),
					"statisFrom":require("../assets/img/active5.png"),
					"customerManage":require("../assets/img/active6.png"),
					"systemManage":require("../assets/img/active8.png"),
					"standardManage":require("../assets/img/active7.png"),
				}],
				modelData: [{
					"name": "",
					"page": "",
					"pageAddress": "",
					"sub": [],
				}],
				reload: false,
				changePsdPop: false,
				rules2: {
					oldPassword: [{
						required: true,

						message: '请输入旧密码',
						trigger: 'blur'
					}],
					newPassword: [{
						required: true,
						validator: validatePass,
						trigger: 'blur'
					}],
					subPassword: [{
						required: true,
						validator: validatePass2,
						trigger: 'blur'
					}],
				},
				passwordForm: {
					oldPassword: '',
					newPassword: '',
					subPassword: '',
				},
				selectPage:null, //当前页面
				ishome:true, //是首页
				loginValue:"",
				isShow:false,
				configData:[],
				isFrom:"",
				CasAddress:"",
			}
		},
		props: ['modelJson', 'fromZujian'],
		computed: {
			...mapState(['topmenu', 'nowpage', 'leftmenuStruchFlag', 'pageName', 'menuName', 'daibanItem']),
		},
		watch: {
			modelJson(val) {
				this.modelData = JSON.parse(JSON.stringify(this.modelJson));
				this.reLoad();
			},
			// 监听当前页面
			'$store.state.nowpage':function(val,oldVal){
				if(val == "homePage"){
					this.ishome = true;
				}else{
					this.ishome = false;
				}
        		this.$forceUpdate()
			}
		},
		created() {
			this.isFrom = localStorage.getItem('isFrom');
			this.CasAddress = localStorage.getItem('CasAddress');
			this.labValue = JSON.parse(sessionStorage.getItem("defaultlabData"));
			this.getlabAuth();
			this.getBellSign();
		},
		mounted() {
            sessionStorage.removeItem('selectedAblity')
			this.getUserInfo();
      		this.getStaList();
			this.toduData();
			if (this.fromZujian == 'zhongxin') {
				this.modelData = this.modelJson
			}
			this.selectPage = this.nowpage
			if(this.labValue == null || this.labValue == "" || this.labValue == undefined){
				if(this.isFrom && this.isFrom == 'selfLogin'){
				this.$router.push('/')
				}else{
				if(this.CasAddress && this.CasAddress!=''){
					window.location.href = this.CasAddress;
				}else{
					this.$router.push('/')
				}
				}
			}
		},
		components: {
			daibanlist
		},
		methods: {
			handleCommand1(command){
				if(command == "changePsd"){
					this.changePsdPop = true;
				}else if(command == "loginout"){
					this.loginOut()
				}else{
					this.sDownload(command)
				}
			},
			sDownload(command){
				var url = "download/springDownload.htm";
				let token = sessionStorage.getItem('loginAccount')?sessionStorage.getItem('loginAccount'):undefined
				window.open(process.env.baseUrl + url +  "?token=" + token + "&fileName=" + command)
			},
			changePassword() {
				this.changePsdPop = true;
			},
			getPassPublicKey() {
				this.$refs.passwordForm.validate((valid) => {
					if (valid) {
						this.passwordForm.oldPassword = this.passwordForm.oldPassword;
						this.passwordForm.newPassword = this.passwordForm.newPassword;
						if(this.passwordForm.newPassword.length < 6){
							this.$notify({
								title: "警告",
								type: "warning",
								message: "新密码必须大于6位！"
							})
							return;
						}
						if(this.passwordForm.newPassword != this.passwordForm.subPassword){
							this.$notify({
								title: "警告",
								type: "warning",
								message: "确认密码和新密码不一致！"
							})
							return;
						}
						this.$http({
							apiUrl: '/getPassPublicKey.htm',
							method: 'post',
						}).then(res => {
							if (res.code == 0) {
							  var map = res.data;
								var encrytor  = new JSEncrypt();
								encrytor.setPublicKey(map.publicKey)
								var passOld = encrytor.encrypt( this.passwordForm.oldPassword)

								var encrytor1  = new JSEncrypt();
								encrytor1.setPublicKey(map.publicKey2)
								var passNew = encrytor1.encrypt( this.passwordForm.newPassword)
								var dataForm = {
										oldKey : res.data.id,
										oldPassword:passOld,
										newKey : res.data.id2,
										newPassword:passNew,
								}
								this.submitPsd(dataForm)
							}
						})
					} else {
					}
				})
			},
			submitPsd(data){
				this.$http({
					apiUrl: '/changePassword.htm',
					method: 'post',
					params: data,
					isJson: false
				}).then(res => {
					if (res.code == 0) {
						this.$notify({
							title: "成功！",
							type: "success",
							message: "修改密码成功"
						})
						this.closePsd()
					}
				})
			},
			closePsd() {
				this.changePsdPop = false;
				this.passwordForm = {
					oldPassword: null,
					newPassword: null,
					subPassword: null,
				};
				this.$refs.passwordForm.resetFields();
			},
			// 获取代办接口数据,确定是否展示红点标识
			getBellSign() {
				let params = {
					type: 2,
					page: 0,
					pagecount: 100
				};
				let flowList = new Promise((resolve, reject) => {
					this.$http({
						method: 'post',
						apiUrl: '/workflow/getWorkflowList.htm',
						params: params,
						isJson: false,
					}).then(res => {
						if (res.code === 0) {

							resolve(res.data)

						}
					}, )
				})
				let groupList = new Promise((resolve, reject) => {
					this.$http({
						method: 'post',
						apiUrl: '/message/readToDoMessageGroupList.htm',
						params: null,
						isJson: false,
					}).then(res => {
						if (res.code === 0) {
							resolve(res.data)
						}
					}, )
				})
				Promise.all([flowList, groupList]).then((res) => {

					this.isHasSign = 0;
					for (let i of res) {
						this.isHasSign += i.length;
					}
				})
			},
			toduData() {//用来判断水司还只中心界面数据来显示待办信息
				if (this.$route.path == '/shuisi') {///zhongxin
					//alert('水司')
					this.todaDataStyle = [{
						name: '检测管理',
						tips: 7,
						src: require("../assets/img/caiyang.png"),
					},
					{
						name: '报告管理',
						tips: 3,
						src: require("../assets/img/get.png"),
						//                topmenu:'1',
						//                 page:'yangpinlingqu',
					},
					{
						name: '检测管理',
						tips: 7,
						src: require("../assets/img/caiyang.png"),
						//                topmenu:'1',
						//                page:'sampleregistration',
					},
					{
						name: '报告管理',
						tips: 3,
						src: require("../assets/img/get.png"),
						//                topmenu:'1',
						//                 page:'yangpinlingqu',
					},
					{
						name: '仪器管理',
						tips: 1,
						src: require("../assets/img/jieshou.png"),
						//                topmenu:'1',
						//                page:'samplereception',
					}, {
						name: '物资管理',
						tips: 1,
						src: require("../assets/img/jiance.png"),
						//                topmenu:'1',
						//                 page:'mygrouptest',
					},

					]
				} else if (this.$route.path == '/zhongxin') {///zhongxin
					//alert('中心')
					this.todaDataStyle = [
						{
							name: '我的检测',
							tips: 3,
							src: require("../assets/img/task.png"),
							pagename: 'mytest'
						},
						{
							name: '我的校核',
							tips: 1,
							src: require("../assets/img/get.png"),
							pagename: 'mycheck'
						},
						{
							name: '结果审核',
							src: require("../assets/img/jieshou.png"),
							tips: 0
						},
						{
							name: '报告审核',
							src: require("../assets/img/jiance.png"),
							tips: 0
						},
						{
							name: '报告签发',
							src: require("../assets/img/get.png"),
							tips: 0
						},
						{
							name: '仪器维护',
							src: require("../assets/img/shenhe.png"),
							tips: 0
						},
						{
							name: '仪器期间核查',
							src: require("../assets/img/jiance.png"),
							tips: 0
						},
						{
							name: '仪器检定校准',
							src: require("../assets/img/jieshou.png"),
							tips: 0
						}]
				}
			},
			checkInfoBtn() {//点击消息按钮出来待办信息弹框
				this.showPop = !this.showPop;
				if (this.showPop == true) {
					this.$refs.infoPopBtn.style.fontWeight = 'bold';
					this.$refs.infoPopBtn.style.color = '#faa646';
				}
			},
			getUserInfo() {
				this.$http({
					method: 'post',
					apiUrl: '/accountInfo.htm',
					params: {}
				}).then(res => {
					if (res.code == 0) {
						this.userInfo = res.data;
						sessionStorage.setItem('laboratoryAccountInfo', JSON.stringify(res.data));
						// global.isSameUser
						global.isSameUser = res.data.loginid;
						localStorage.setItem('labUserId',res.data.loginid); // 判断是否已经登录
					} else {
						this.$router.push('/selectDep')
					}

				});
			},
			getStaList(){
				this.$http({
					method: 'post',
					apiUrl: '/system/getOffices.htm',
					params: {name:''},
				isJson:true
				}).then(res => {
					if (res.code === 0) {
						sessionStorage.setItem('stationList',JSON.stringify(res.data))
					}
				})
			},
			loginOut() {
				// JSON.parse(sessionStorage.getItem('laboratoryAccountInfo')).loginid
				this.$http({
					method: 'post',
					apiUrl: '/exlogout.htm',
					params:{
						username:JSON.parse(sessionStorage.getItem('laboratoryAccountInfo')).loginid
					},
					isJson:false,
				}).then(res => {
					if(res.code == 0){
            			sessionStorage.removeItem('loginAccount');  //退出清空
						sessionStorage.removeItem('labAccountInfo');  //退出清空
						if(this.isFrom && this.isFrom == 'selfLogin'){
							this.$router.push('/')
						}else{
							if(this.CasAddress && this.CasAddress!=''){
								window.location.href = this.CasAddress;
							}else{
								this.$router.push('/')
							}
						}
						localStorage.removeItem('isFrom');  //退出清空
					}
				})
			},
			getlabAuth() {
				this.$http({
					apiUrl: 'login/getlabAuth.htm',
					method: 'post',
				}).then(res => {
					if (res.code == 0) {
						this.labData = res.data;
					}
				})
			},
			async changeLab(val) {
       			// changeGlobalLoad
                this.$store.commit('changeGlobalLoad', true);
				let res = await this.$http({
					apiUrl: 'login/chooselab.htm',
					method: 'post',
					params: {
						id: val.id,
            			mark:val.mark,
					},
					isJson: false
				})
				if (res.code === 0) {
					var that = this;
					setTimeout(function(){
						that.$store.commit('changeGlobalLoad', false);
      					that.getStaList();
					},3000)
					sessionStorage.removeItem("defaultlabData");
					sessionStorage.setItem("defaultlabData", JSON.stringify(val));
					this.labValue = JSON.parse(sessionStorage.getItem("defaultlabData"));
					// this.$router.push("/shuisi")
					// this.$router.go(0)
					// console.log(this.nowpage)
					if(this.nowpage == 'homePage'){
						this.$router.go(0)
					}else{
						this.$store.commit('changenowpage', 'homePage');
						this.$store.state.menuName = '';
						this.$store.state.pageName = '';
						this.changetopmenu(this.modelData[0], 0)
					}
				} else {
            		this.labValue = JSON.parse(sessionStorage.getItem("defaultlabData"));
             		this.$store.commit('changeGlobalLoad', false);
                }
			},
			//重载数据
			reLoad() {
				this.reload = false;
				this.$nextTick(() => {
					//dom元素更新后执行，此时能拿到p元素的属性
					// this.message = this.$refs.myWidth.offsetWidth;
					this.reload = true;
				})
			},
			openpage: function (item, pagename) {
				console.log(item, pagename)
				this.$store.state.pageName = item.name;
				// 点击切换页面 重新储存页面按钮数据
				this.$store.state.moduleId = item.id;
				this.selUserOpernationByModelId(item).then(res => {
					sessionStorage.setItem("userOpernation", JSON.stringify(res.data))
					this.$store.commit('changenowpage', pagename)
				}).catch(err => {
					this.$store.commit('changenowpage', pagename)
				})
			},
			//根据菜单id获取操作项
			selUserOpernationByModelId(item) {
				return new Promise((resolve, reject) => {
					this.$http({
						apiUrl: '/selUserOpernationByModelId.htm',
						method: 'post',
						params: {
							moduleId: item.id
						},
						isJson: false
					}).then(res => {
						// console.log(res)
						if (res.code === 0) {
							resolve(res)
						}
					})
				})
			},
			async changetopmenu(item, name) {

           if(this.buttonFlag) {
             this.$set(this, 'buttonFlag', false)
             console.log(item,name)
             this.selectPage = item.pageAddress
             this.$store.commit('changetopmenu', name)
             this.$store.state.menuName = item.name;
             //根据当前点击得头部按钮得page，默认显示第一个页面
             var currentPage = null;
             var currentPageName = null;
             // 实验室数据
             if (item.page == 'homePage') { //如果点击得是首页，显示得对应page地址是homePage
               currentPage = 'homePage';
               this.$store.state.menuName = null;
               currentPageName = null;
               this.$store.commit('changenowpage', currentPage);
             } else {   //如果点击的头部sub没有子集,就默认显示sub[0],如果sub还有一个sub子集 显示得第一个sub的第一个子集    sub[0].sub[0]
               if (item.sub[0].sub == undefined || item.sub[0].sub.length == 0) {
                 // console.log(item.sub[0])
                 currentPage = item.sub[0].page;
                 currentPageName = item.sub[0].name;
                 // 点击切换页面 重新储存页面按钮数据
                 this.$store.state.moduleId = item.sub[0].id;
                 this.selUserOpernationByModelId(item.sub[0]).then(res => {
                   sessionStorage.setItem("userOpernation", JSON.stringify(res.data))
                   this.$store.commit('changenowpage', currentPage);
                 }).catch(err => {
                   this.$store.commit('changenowpage', currentPage);
                 })

               } else {
                 currentPage = item.sub[0].sub[0].page;
                 currentPageName = item.sub[0].sub[0].name;
                 this.$store.state.moduleId = item.sub[0].sub[0].id;
                 this.selUserOpernationByModelId(item.sub[0].sub[0]).then(res => {
                   sessionStorage.setItem("userOpernation", JSON.stringify(res.data))
                   this.$store.commit('changenowpage', currentPage);
                 }).catch(err => {
                   this.$store.commit('changenowpage', currentPage);
                 })
               }
             }
             // if(item.page == "testManage"){
             // 	this.delUnnecessaryData();
             // }
             if (item.page == "zhongxinReport" || item.page == "zhongxinTest") {
               if (item.sub[0].sub == undefined || item.sub[0].sub.length == 0) {
                 currentPage = item.sub[0].page;
                 currentPageName = item.sub[0].name;
               } else {
                 currentPage = item.sub[0].sub[0].page;
                 currentPageName = item.sub[0].sub[0].name;
               }
             }
             // this.$store.commit('changenowpage', currentPage);
             this.$store.state.pageName = currentPageName;
             this.$store.commit('changetopmenu', name)
             setTimeout(() => {
               this.$set(this, 'buttonFlag', true)
             }, 500)
           }
        // this.$forceUpdate()
			},
			// 检测管理删除数据
			delUnnecessaryData(){
				this.$http({
					method: 'post',
					apiUrl: '/detection/delUnnecessaryData.htm',
				}).then(res => {})
			},
			menustrutch() {
				this.$store.commit('changeleftmenuStruchFlag')

			},

			handleCommand(command) {
				$(".el-dropdown-link").html(command + ' <i class="el-icon-arrow-down el-icon--right"></i>')

			},
		}
	}

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
	.loginOut .el-select__caret.el-input__icon.el-icon-arrow-up{
		display:none !important;
	}
	.userInfo .el-dropdown .el-icon-caret-bottom{
		color:#fff !important;
	}
	.router-link-exact-active.router-link-active:link,
	.router-link-exact-active.router-link-active:visited,
	.router-link-exact-active.router-link-active:hover {
		text-decoration: none
	}

	.hasSign {
		position: relative;
	}

	.hasSign::after {
		content: '';
		display: table;
		position: absolute;
		height: 8px;
		width: 8px;
		background: red;
		border-radius: 50%;
		top: 10px;
		right: 19px;
	}

	.logo1 .lab {
		color: #fff;
		font-size: 18px;
		/*font-weight: 550;*/
		letter-spacing: 4px;
		height: 36px;
		line-height: 36px;
		text-align: center;
	}

	.infoPopBox {
		position: relative;
	}

	.infoPopBtn {
		padding: 0 20px;
		line-height: 36px;
		font-size: 16px;
	}

	.infoPopBtn:hover {
		font-weight: bold;
		color: #faa646;
	}

	.changeLab.el-select.el-select--mini {
		width: 140px !important;
		margin-right: 15px;
	}

	.changeLab.el-select .el-input__inner {
		/* padding: 0 0 0 5px !important;
		border: none; */
		background: transparent;
		/* color: #fff; */
		height: 30px;
		line-height: 25px;
		color: #fff!important;
		font-size: 14px;
		border-radius: 40px;
	}

	.changeLab.el-select .el-input__suffix {
		right: 0 !important;
	}

	.changeLab.el-select .el-input__suffix i {
		color: #fff;
	}

	.changeLab :-moz-placeholder {
		/* Mozilla Firefox 4 to 18 */
		color: #fff;
	}

	.changeLab ::-moz-placeholder {
		/* Mozilla Firefox 19+ */
		color: #fff;
	}

	.changeLab input:-ms-input-placeholder {
		color: #fff;
	}

	.changeLab input::-webkit-input-placeholder {
		color: #fff;
	}
</style>
<style scoped>
	.userInfo {
		white-space: nowrap;
		text-align: right;
		padding-right: 20px;
	}


	.el-col {
		border-radius: 4px;
	}

	.bg-purple-dark {
		background: #99a9bf;
	}

	.bg-purple {
		background: #d3dce6;
	}

	.bg-purple-light {
		background: #e5e9f2;
	}

	.grid-content {
		border-radius: 4px;
		min-height: 36px;
	}

	.row-bg {
		padding: 10px 0;
		background-color: #f9fafc;
	}
</style>
